/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PuGeneralPreData extends BasicModel<PuGeneralPreData> {
  pkCorp?: string; // 公司主键
  sourceId?: string; // source_id
  venId?: string; // 供应商ID
  venName?: string; // 供应商名称
  cgDeptId?: string; // 采购部门ID
  cgDeptName?: string; // 采购部门名称
  busType?: string; // 业务流程ID
  busTypeName?: string; // 业务流程名称
  rkCode?: string; // 入库单号
  rkDate?: string; // 入库日期
  orderCode?: string; // 订单号
  orderDate?: string; // 订单日期
  invId?: string; // 存货ID
  kpQty?: number; // 本次开票数
  nprice?: number; // 无税单价
  nmny?: number; // 无税金额
  ntaxprice?: number; // 含税单价
  ntaxmny?: number; // 含税金额
  nictaxrate?: number; // 税率
  noritaxmny?: number; // 税额
  createByName?: string; // 准备人名称
}

export const puGeneralPreDataList = (params?: PuGeneralPreData | any) =>
  defHttp.get<PuGeneralPreData>({ url: adminPath + '/srm/cw/prekp/puGeneralPreData/list', params });

export const puGeneralPreDataListData = (params?: PuGeneralPreData | any) =>
  defHttp.post<Page<PuGeneralPreData>>({
    url: adminPath + '/srm/cw/prekp/puGeneralPreData/listData',
    params,
  });

export const puGeneralPreDataForm = (params?: PuGeneralPreData | any) =>
  defHttp.get<PuGeneralPreData>({ url: adminPath + '/srm/cw/prekp/puGeneralPreData/form', params });

export const puGeneralPreDataSave = (params?: any, data?: PuGeneralPreData | any) =>
  defHttp.postJson<PuGeneralPreData>({
    url: adminPath + '/srm/cw/prekp/puGeneralPreData/save',
    params,
    data,
  });

export const puGeneralPreDataDelete = (params?: PuGeneralPreData | any) =>
  defHttp.get<PuGeneralPreData>({
    url: adminPath + '/srm/cw/prekp/puGeneralPreData/delete',
    params,
  });

export const puGeneralPreDataPushKpBill = (params?: PuGeneralPreData | any) =>
  defHttp.get<PuGeneralPreData>({
    url: adminPath + '/srm/cw/prekp/puGeneralPreData/pushKpBill',
    params,
  });
